﻿<phone:PhoneApplicationPage 
    x:Class="CalciumTemplateApp.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c="clr-namespace:DanielVaughan.Windows.Controls;assembly=Calcium.Phone"
    xmlns:c2="clr-namespace:DanielVaughan.Windows;assembly=Calcium.Phone"
    xmlns:controls="clr-namespace:CalciumTemplateApp.Controls" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    shell:SystemTray.IsVisible="{Binding AppSettings.SystemTrayVisible, FallbackValue=true}"
    c2:VisualStateUtility.VisualState="{Binding VisualState}"
    Style="{StaticResource PageStyle}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait">

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- The app and page title are presented with the TitleControl. -->
        <controls:TitleControl />

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <!-- Begin remove this example XAML -->   
            <StackPanel VerticalAlignment="Top">
                <StackPanel.Resources>
                    <Style x:Name="HyperlinkButtonStyle" 
                           TargetType="HyperlinkButton">
                        <Setter Property="Margin" Value="20" />
                        <Setter Property="HorizontalAlignment" Value="Left" />
                        <Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}" />
                    </Style>
                </StackPanel.Resources>
                <TextBlock Text="examples" Style="{StaticResource PhoneTextTitle2Style}" />
                <HyperlinkButton Content="property persistency"
                                 NavigateUri="/Views/Examples/PersistencyExampleView.xaml" 
                                 Style="{StaticResource HyperlinkButtonStyle}" />
                <HyperlinkButton Content="input validation"
                                 NavigateUri="/Views/Examples/ValidationExampleView.xaml" 
                                 Style="{StaticResource HyperlinkButtonStyle}" />
                <HyperlinkButton Content="composite input validation"
                                 NavigateUri="/Views/Examples/CompositeValidation/CompositeValidationView.xaml" 
                                 Style="{StaticResource HyperlinkButtonStyle}" />
                <TextBlock TextWrapping="Wrap" Margin="12,24,0,0">
                    The app bar contains various menu items that can remain in place.
                    Registation and Review links use mock tasks when using a debug build configuration. 
                    Phone task type registrations are performed in the BootStrapper class.
                    A release build uses the production types.
                </TextBlock>
            </StackPanel>
            <!-- End remove this example XAML -->
        </Grid>

        <!-- AppBar enhances the built-in ApplicationBar control 
            to provide data-binding and various button types 
            including toggle buttons and hyperlink buttons etc. -->
        <c:AppBar>
            <c:AppBarHyperlinkButton 
                    NavigateUri="/Views/DashboardView.xaml"
                    Text="{Binding Resources.Instance.Commands_ViewDashboard, 
                                   Source={StaticResource Resources}}"
                    IconUri="/Views/Images/AppBar/appbar.feature.settings.rest.png" />
            <c:AppBar.MenuItems>
                <c:AppBarMenuItem
                    Command="{Binding RegisterCommand}"
                    Text="{Binding Resources.Instance.Commands_Register, 
                                   Source={StaticResource Resources}}" 
                    Visibility="{Binding MarketplaceService.Trial,
                                         Converter={StaticResource BooleanToVisibilityConverter}}" />
                <c:AppBarMenuItem
                    Command="{Binding ReviewCommand}"
                    Text="{Binding Resources.Instance.Commands_Review, 
                                   Source={StaticResource Resources}}" />
                <c:AppBarHyperlinkMenuItem
                    NavigateUri="/Views/DashboardView.xaml"
                    Text="{Binding Resources.Instance.Commands_ViewDashboard, 
                                   Source={StaticResource Resources}}" />
            </c:AppBar.MenuItems>
        </c:AppBar>
    </Grid>
 
</phone:PhoneApplicationPage>